package ${projectDefinitionDO.serverProjectDefinitionDO.serverProjectStartClassPackagePathName}.controller;

import org.springframework.http.HttpStatus;
import org.springframework.validation.BindException;
import org.springframework.web.bind.annotation.*;
import org.web.base.domain.ViewResultHelper;
import org.web.base.domain.view.ViewResultDO;

@ControllerAdvice
@RestController
public class ExceptionHandler {

    @org.springframework.web.bind.annotation.ExceptionHandler(BindException.class)
    @ResponseStatus(HttpStatus.UNPROCESSABLE_ENTITY)
    public ViewResultDO handleBindException(BindException ex) {
        return ViewResultHelper.handleBindException(ex);
    }

}